\hypertarget{classsock_1_1net_1_1_tcp_server}{}\section{sock\+:\+:net\+:\+:Tcp\+Server Class Reference}
\label{classsock_1_1net_1_1_tcp_server}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}


{\ttfamily \#include $<$tcp\+\_\+server.\+h$>$}

Inheritance diagram for sock\+:\+:net\+:\+:Tcp\+Server\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classsock_1_1net_1_1_tcp_server}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structsock_1_1net_1_1_tcp_server_1_1_config}{Config}
\begin{DoxyCompactList}\small\item\em 配置数据 \end{DoxyCompactList}\item 
struct \hyperlink{structsock_1_1net_1_1_tcp_server_1_1_statics}{Statics}
\begin{DoxyCompactList}\small\item\em 状态信息 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26c}{Options} \{ \\*
\hyperlink{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26cae14a3e48f9466cf5533f6501065e5d8f}{W\+O\+R\+K\+E\+R\+\_\+\+N\+U\+M}, 
\hyperlink{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca52b8a6d182527f5cbf89ce8fcebd6b6b}{H\+E\+A\+R\+T\+B\+E\+A\+T\+\_\+\+T\+I\+M\+E}, 
\hyperlink{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca4b64346c3e4b3ae76cf612e103d98638}{F\+R\+A\+M\+E\+\_\+\+T\+I\+M\+E}, 
\hyperlink{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca0eb2364f1f8f1ee1f86670d030370bb3}{C\+O\+N\+N\+\_\+\+I\+S\+S\+I\+Z\+E}, 
\\*
\hyperlink{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26cad2dd1e3c9592315e4a98df0519c3b299}{C\+O\+N\+N\+\_\+\+O\+S\+S\+I\+Z\+E}
 \}\begin{DoxyCompactList}\small\item\em 服务器配置参数 \end{DoxyCompactList}
\item 
enum \hyperlink{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347}{State} \{ \hyperlink{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347ae78386eefc569f2c07c58b66cb0751da}{R\+E\+A\+D\+Y}, 
\hyperlink{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347add196db3e514c0fa131ec4b2e36ec25b}{R\+U\+N\+N\+I\+N\+G}, 
\hyperlink{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347ad1b2046ce4c56bad7b7a9a090a7e2021}{E\+X\+I\+T\+I\+N\+G}, 
\hyperlink{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347a0216946439f9bc60432110c9e2da378d}{E\+X\+I\+T}
 \}\begin{DoxyCompactList}\small\item\em 状态 \end{DoxyCompactList}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classsock_1_1net_1_1_tcp_server_ad6d1a8405d96f2479c297918c396d212}{Tcp\+Server} (void)
\item 
\hyperlink{classsock_1_1net_1_1_tcp_server_a226792a6bb7cccdb4eb6dfdf8851326c}{$\sim$\+Tcp\+Server} (void)
\item 
bool \hyperlink{classsock_1_1net_1_1_tcp_server_afc40c8a3ac309ae92182de21a014d4cd}{open} (const char $\ast$addr, int port, int backlog)
\begin{DoxyCompactList}\small\item\em 启动服务器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_a750bc64764b1277beee95ba9231f0f08}{run} (void)
\begin{DoxyCompactList}\small\item\em 运行服务器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_a8858c03e9c473d4a8313315c267fef28}{close} (void)
\begin{DoxyCompactList}\small\item\em 关闭服务器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_a604b0305e6e7c6766af27dbd5a8f2d24}{config} (\hyperlink{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26c}{Options} optname, void $\ast$optval)
\begin{DoxyCompactList}\small\item\em 配置服务器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_a4cd23b2b8566abc9d4f167b2c0488095}{set\+Connection\+Factory} (\hyperlink{namespacesock_1_1net_a2ddc58693b405832076a3d76dc133671}{Tcp\+Connection\+Factory\+Ptr} factory)
\begin{DoxyCompactList}\small\item\em 设置连接工厂 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_aa44d4d1608416e7fca8935090c5ef6ca}{get\+Statics} (\hyperlink{structsock_1_1net_1_1_tcp_server_1_1_statics}{Statics} \&statics)
\begin{DoxyCompactList}\small\item\em 获取服务器状态数据 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_ac1ca3065af98af784c65622431db16b5}{get\+Config} (\hyperlink{structsock_1_1net_1_1_tcp_server_1_1_config}{Config} \&\hyperlink{classsock_1_1net_1_1_tcp_server_a604b0305e6e7c6766af27dbd5a8f2d24}{config})
\begin{DoxyCompactList}\small\item\em 获取服务器当前配置 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_ab68be9fc6db7094c2b6ca6b1650399e3}{set\+Connection\+Read\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a836ed49de731537f208e17d07868a9d8}{Tcp\+Connection\+::\+Tcp\+Connection\+Read\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置读回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_ae950d0e397409f17f8eaeb2d191abdd6}{set\+Connection\+Write\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_ab8951d995ac681b06a8d8dfdadd219aa}{Tcp\+Connection\+::\+Tcp\+Connection\+Write\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置写回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_a0641cbef81380437d1c420e9883a9840}{set\+Connection\+Error\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置错误回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_a6fc6f8dc248d7338478316126bf37319}{set\+Connection\+Close\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置关闭回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_add5343d5b2e2f7a7536fdb88a9dd4033}{set\+Connection\+Heartbeat\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_connection_a9d9ea93c3a51141616167ae78c0238ec}{Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置心跳回调 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1net_1_1_tcp_server_aed1da477683c9942e4c04f891b0050c5}{set\+Connection\+Established\+F\+N} (\hyperlink{classsock_1_1net_1_1_tcp_acceptor_a4f61b7c7e32c3cc975f394efbfced020}{Tcp\+Acceptor\+::\+Pass\+Tcp\+Connection\+Ptr\+Ref\+Func} fn)
\begin{DoxyCompactList}\small\item\em 设置新连接回调 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classsock_1_1net_1_1_tcp_server_a43fe1eaa6c6b4d4ecbb2ba361d312b66}{Tcp\+Connection}
\item 
class \hyperlink{classsock_1_1net_1_1_tcp_server_a0736aba6eec2f2c2a13494228473b67c}{Tcp\+Worker}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
T\+C\+P服务器 

\subsection{Member Enumeration Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26c}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!Options@{Options}}
\index{Options@{Options}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{Options}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf sock\+::net\+::\+Tcp\+Server\+::\+Options}}\label{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26c}


服务器配置参数 

\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{W\+O\+R\+K\+E\+R\+\_\+\+N\+U\+M@{W\+O\+R\+K\+E\+R\+\_\+\+N\+U\+M}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!W\+O\+R\+K\+E\+R\+\_\+\+N\+U\+M@{W\+O\+R\+K\+E\+R\+\_\+\+N\+U\+M}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26cae14a3e48f9466cf5533f6501065e5d8f}{}W\+O\+R\+K\+E\+R\+\_\+\+N\+U\+M\label{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26cae14a3e48f9466cf5533f6501065e5d8f}
}]\index{H\+E\+A\+R\+T\+B\+E\+A\+T\+\_\+\+T\+I\+M\+E@{H\+E\+A\+R\+T\+B\+E\+A\+T\+\_\+\+T\+I\+M\+E}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!H\+E\+A\+R\+T\+B\+E\+A\+T\+\_\+\+T\+I\+M\+E@{H\+E\+A\+R\+T\+B\+E\+A\+T\+\_\+\+T\+I\+M\+E}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca52b8a6d182527f5cbf89ce8fcebd6b6b}{}H\+E\+A\+R\+T\+B\+E\+A\+T\+\_\+\+T\+I\+M\+E\label{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca52b8a6d182527f5cbf89ce8fcebd6b6b}
}]\index{F\+R\+A\+M\+E\+\_\+\+T\+I\+M\+E@{F\+R\+A\+M\+E\+\_\+\+T\+I\+M\+E}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!F\+R\+A\+M\+E\+\_\+\+T\+I\+M\+E@{F\+R\+A\+M\+E\+\_\+\+T\+I\+M\+E}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca4b64346c3e4b3ae76cf612e103d98638}{}F\+R\+A\+M\+E\+\_\+\+T\+I\+M\+E\label{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca4b64346c3e4b3ae76cf612e103d98638}
}]\index{C\+O\+N\+N\+\_\+\+I\+S\+S\+I\+Z\+E@{C\+O\+N\+N\+\_\+\+I\+S\+S\+I\+Z\+E}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!C\+O\+N\+N\+\_\+\+I\+S\+S\+I\+Z\+E@{C\+O\+N\+N\+\_\+\+I\+S\+S\+I\+Z\+E}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca0eb2364f1f8f1ee1f86670d030370bb3}{}C\+O\+N\+N\+\_\+\+I\+S\+S\+I\+Z\+E\label{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26ca0eb2364f1f8f1ee1f86670d030370bb3}
}]\index{C\+O\+N\+N\+\_\+\+O\+S\+S\+I\+Z\+E@{C\+O\+N\+N\+\_\+\+O\+S\+S\+I\+Z\+E}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!C\+O\+N\+N\+\_\+\+O\+S\+S\+I\+Z\+E@{C\+O\+N\+N\+\_\+\+O\+S\+S\+I\+Z\+E}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26cad2dd1e3c9592315e4a98df0519c3b299}{}C\+O\+N\+N\+\_\+\+O\+S\+S\+I\+Z\+E\label{classsock_1_1net_1_1_tcp_server_abec9ec73a9e95554ec1dd46ebcebb26cad2dd1e3c9592315e4a98df0519c3b299}
}]\end{description}
\end{Desc}
\hypertarget{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!State@{State}}
\index{State@{State}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{State}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf sock\+::net\+::\+Tcp\+Server\+::\+State}}\label{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347}


状态 

\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{R\+E\+A\+D\+Y@{R\+E\+A\+D\+Y}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!R\+E\+A\+D\+Y@{R\+E\+A\+D\+Y}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347ae78386eefc569f2c07c58b66cb0751da}{}R\+E\+A\+D\+Y\label{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347ae78386eefc569f2c07c58b66cb0751da}
}]\index{R\+U\+N\+N\+I\+N\+G@{R\+U\+N\+N\+I\+N\+G}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!R\+U\+N\+N\+I\+N\+G@{R\+U\+N\+N\+I\+N\+G}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347add196db3e514c0fa131ec4b2e36ec25b}{}R\+U\+N\+N\+I\+N\+G\label{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347add196db3e514c0fa131ec4b2e36ec25b}
}]\index{E\+X\+I\+T\+I\+N\+G@{E\+X\+I\+T\+I\+N\+G}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!E\+X\+I\+T\+I\+N\+G@{E\+X\+I\+T\+I\+N\+G}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347ad1b2046ce4c56bad7b7a9a090a7e2021}{}E\+X\+I\+T\+I\+N\+G\label{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347ad1b2046ce4c56bad7b7a9a090a7e2021}
}]\index{E\+X\+I\+T@{E\+X\+I\+T}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!E\+X\+I\+T@{E\+X\+I\+T}}\item[{\em 
\hypertarget{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347a0216946439f9bc60432110c9e2da378d}{}E\+X\+I\+T\label{classsock_1_1net_1_1_tcp_server_afb7b447f9f67ed9f1a3f93e15f43b347a0216946439f9bc60432110c9e2da378d}
}]\end{description}
\end{Desc}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_server_ad6d1a8405d96f2479c297918c396d212}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!Tcp\+Server@{Tcp\+Server}}
\index{Tcp\+Server@{Tcp\+Server}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{Tcp\+Server(void)}]{\setlength{\rightskip}{0pt plus 5cm}Tcp\+Server\+::\+Tcp\+Server (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_ad6d1a8405d96f2479c297918c396d212}
\hypertarget{classsock_1_1net_1_1_tcp_server_a226792a6bb7cccdb4eb6dfdf8851326c}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!````~Tcp\+Server@{$\sim$\+Tcp\+Server}}
\index{````~Tcp\+Server@{$\sim$\+Tcp\+Server}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{$\sim$\+Tcp\+Server(void)}]{\setlength{\rightskip}{0pt plus 5cm}Tcp\+Server\+::$\sim$\+Tcp\+Server (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_a226792a6bb7cccdb4eb6dfdf8851326c}


\subsection{Member Function Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_server_a8858c03e9c473d4a8313315c267fef28}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!close@{close}}
\index{close@{close}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{close(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Server\+::close (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_a8858c03e9c473d4a8313315c267fef28}


关闭服务器 

\hypertarget{classsock_1_1net_1_1_tcp_server_a604b0305e6e7c6766af27dbd5a8f2d24}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!config@{config}}
\index{config@{config}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{config(\+Options optname, void $\ast$optval)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Server\+::config (
\begin{DoxyParamCaption}
\item[{{\bf Options}}]{optname, }
\item[{void $\ast$}]{optval}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_a604b0305e6e7c6766af27dbd5a8f2d24}


配置服务器 


\begin{DoxyParams}{Parameters}
{\em optname} & 选项名 \\
\hline
{\em optval} & 选项值 \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_ac1ca3065af98af784c65622431db16b5}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!get\+Config@{get\+Config}}
\index{get\+Config@{get\+Config}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{get\+Config(\+Config \&config)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Server\+::get\+Config (
\begin{DoxyParamCaption}
\item[{{\bf Config} \&}]{config}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_ac1ca3065af98af784c65622431db16b5}


获取服务器当前配置 


\begin{DoxyParams}{Parameters}
{\em config} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_aa44d4d1608416e7fca8935090c5ef6ca}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!get\+Statics@{get\+Statics}}
\index{get\+Statics@{get\+Statics}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{get\+Statics(\+Statics \&statics)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Server\+::get\+Statics (
\begin{DoxyParamCaption}
\item[{{\bf Statics} \&}]{statics}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_aa44d4d1608416e7fca8935090c5ef6ca}


获取服务器状态数据 


\begin{DoxyParams}{Parameters}
{\em statics} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_afc40c8a3ac309ae92182de21a014d4cd}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!open@{open}}
\index{open@{open}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{open(const char $\ast$addr, int port, int backlog)}]{\setlength{\rightskip}{0pt plus 5cm}bool Tcp\+Server\+::open (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{addr, }
\item[{int}]{port, }
\item[{int}]{backlog}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_afc40c8a3ac309ae92182de21a014d4cd}


启动服务器 


\begin{DoxyParams}{Parameters}
{\em addr} & 监听地址 \\
\hline
{\em port} & 监听端口 \\
\hline
{\em backlog} & 监听队列长度 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bool 
\end{DoxyReturn}
\hypertarget{classsock_1_1net_1_1_tcp_server_a750bc64764b1277beee95ba9231f0f08}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!run@{run}}
\index{run@{run}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{run(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Tcp\+Server\+::run (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1net_1_1_tcp_server_a750bc64764b1277beee95ba9231f0f08}


运行服务器 

\hypertarget{classsock_1_1net_1_1_tcp_server_a6fc6f8dc248d7338478316126bf37319}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!set\+Connection\+Close\+F\+N@{set\+Connection\+Close\+F\+N}}
\index{set\+Connection\+Close\+F\+N@{set\+Connection\+Close\+F\+N}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{set\+Connection\+Close\+F\+N(\+Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Server\+::set\+Connection\+Close\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_server_a6fc6f8dc248d7338478316126bf37319}


设置关闭回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_a0641cbef81380437d1c420e9883a9840}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!set\+Connection\+Error\+F\+N@{set\+Connection\+Error\+F\+N}}
\index{set\+Connection\+Error\+F\+N@{set\+Connection\+Error\+F\+N}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{set\+Connection\+Error\+F\+N(\+Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Server\+::set\+Connection\+Error\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_server_a0641cbef81380437d1c420e9883a9840}


设置错误回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_aed1da477683c9942e4c04f891b0050c5}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!set\+Connection\+Established\+F\+N@{set\+Connection\+Established\+F\+N}}
\index{set\+Connection\+Established\+F\+N@{set\+Connection\+Established\+F\+N}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{set\+Connection\+Established\+F\+N(\+Tcp\+Acceptor\+::\+Pass\+Tcp\+Connection\+Ptr\+Ref\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Server\+::set\+Connection\+Established\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Acceptor\+::\+Pass\+Tcp\+Connection\+Ptr\+Ref\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_server_aed1da477683c9942e4c04f891b0050c5}


设置新连接回调 

\hypertarget{classsock_1_1net_1_1_tcp_server_a4cd23b2b8566abc9d4f167b2c0488095}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!set\+Connection\+Factory@{set\+Connection\+Factory}}
\index{set\+Connection\+Factory@{set\+Connection\+Factory}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{set\+Connection\+Factory(\+Tcp\+Connection\+Factory\+Ptr factory)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Server\+::set\+Connection\+Factory (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+Factory\+Ptr}}]{factory}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_server_a4cd23b2b8566abc9d4f167b2c0488095}


设置连接工厂 


\begin{DoxyParams}{Parameters}
{\em factory} & 连接工厂 \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_add5343d5b2e2f7a7536fdb88a9dd4033}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!set\+Connection\+Heartbeat\+F\+N@{set\+Connection\+Heartbeat\+F\+N}}
\index{set\+Connection\+Heartbeat\+F\+N@{set\+Connection\+Heartbeat\+F\+N}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{set\+Connection\+Heartbeat\+F\+N(\+Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Server\+::set\+Connection\+Heartbeat\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+::\+Pass\+Tcp\+Connection\+Ref\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_server_add5343d5b2e2f7a7536fdb88a9dd4033}


设置心跳回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_ab68be9fc6db7094c2b6ca6b1650399e3}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!set\+Connection\+Read\+F\+N@{set\+Connection\+Read\+F\+N}}
\index{set\+Connection\+Read\+F\+N@{set\+Connection\+Read\+F\+N}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{set\+Connection\+Read\+F\+N(\+Tcp\+Connection\+::\+Tcp\+Connection\+Read\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Server\+::set\+Connection\+Read\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+::\+Tcp\+Connection\+Read\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_server_ab68be9fc6db7094c2b6ca6b1650399e3}


设置读回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1net_1_1_tcp_server_ae950d0e397409f17f8eaeb2d191abdd6}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!set\+Connection\+Write\+F\+N@{set\+Connection\+Write\+F\+N}}
\index{set\+Connection\+Write\+F\+N@{set\+Connection\+Write\+F\+N}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{set\+Connection\+Write\+F\+N(\+Tcp\+Connection\+::\+Tcp\+Connection\+Write\+Func fn)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::net\+::\+Tcp\+Server\+::set\+Connection\+Write\+F\+N (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\+Connection\+::\+Tcp\+Connection\+Write\+Func}}]{fn}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1net_1_1_tcp_server_ae950d0e397409f17f8eaeb2d191abdd6}


设置写回调 


\begin{DoxyParams}{Parameters}
{\em fn} & \\
\hline
\end{DoxyParams}


\subsection{Friends And Related Function Documentation}
\hypertarget{classsock_1_1net_1_1_tcp_server_a43fe1eaa6c6b4d4ecbb2ba361d312b66}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!Tcp\+Connection@{Tcp\+Connection}}
\index{Tcp\+Connection@{Tcp\+Connection}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{Tcp\+Connection}]{\setlength{\rightskip}{0pt plus 5cm}friend class {\bf Tcp\+Connection}\hspace{0.3cm}{\ttfamily [friend]}}\label{classsock_1_1net_1_1_tcp_server_a43fe1eaa6c6b4d4ecbb2ba361d312b66}
\hypertarget{classsock_1_1net_1_1_tcp_server_a0736aba6eec2f2c2a13494228473b67c}{}\index{sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}!Tcp\+Worker@{Tcp\+Worker}}
\index{Tcp\+Worker@{Tcp\+Worker}!sock\+::net\+::\+Tcp\+Server@{sock\+::net\+::\+Tcp\+Server}}
\subsubsection[{Tcp\+Worker}]{\setlength{\rightskip}{0pt plus 5cm}friend class {\bf Tcp\+Worker}\hspace{0.3cm}{\ttfamily [friend]}}\label{classsock_1_1net_1_1_tcp_server_a0736aba6eec2f2c2a13494228473b67c}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
E\+:/git/sock/sock/net/\hyperlink{tcp__server_8h}{tcp\+\_\+server.\+h}\item 
E\+:/git/sock/src/net/\hyperlink{tcp__server_8cc}{tcp\+\_\+server.\+cc}\end{DoxyCompactItemize}
